Skip to content

feat(linux): support frame-pointer-only recording - #12

Merged
not-matthias merged 2 commits into
codspeedfrom
cod-3861-support-samply-fp-unwinding
Nov 3, 2026
Merged

not-matthias merged 2 commits into
codspeedfrom
cod-3861-support-samply-fp-unwinding

Conversation

@not-matthias

@not-matthias not-matthias commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

TLDR: Add samply record --unwinding-mode fp to use kernel frame-pointer callchains without copying user stacks or registers (Linux only).

  • Keep dwarf as the default with the existing kernel-FP fallback; preserve FP mode for launch, PID attach, and software-event fallback.
  • Fix perf flag ordering so kernel callchains remain excluded when kernel sampling is disabled.
  • Add eight behavior tests for CLI selection, frame ordering, context transitions, and leaf/empty callchains. cargo test -p samply --locked: 28 passed, one existing ignored test.
  • Live recording of a frame-pointer-enabled C workload verified launch, attach, software fallback, and default recording. Syscall traces confirmed FP mode omits stack/register capture; caller chains had no duplicate frames.
  • Fix the macOS startup race exposed by the existing dsymutil CI test: keep accepted processes suspended until their initial threads and libraries have been read.

FP stacks require preserved frame pointers throughout the call chain and remain subject to kernel/architecture support and callchain depth limits.

Refs COD-3861.

@GuillaumeLagrange GuillaumeLagrange left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@not-matthias could you clean up a bit this pr after my forcepush of codspeed? I think it includes some commits that should not appear here because of me 😬

@not-matthias
not-matthias force-pushed the cod-3861-support-samply-fp-unwinding branch from ad8f286 to fa031b6 Compare November 2, 2026 15:47
@not-matthias
not-matthias requested review from GuillaumeLagrange and removed request for GuillaumeLagrange November 2, 2026 15:51
@not-matthias
not-matthias force-pushed the cod-3861-support-samply-fp-unwinding branch from fa031b6 to 28c561b Compare November 2, 2026 15:55

@GuillaumeLagrange GuillaumeLagrange left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

olgtm

Comment thread samply/src/shared/prop_types.rs Resolved
Comment thread samply/src/cli.rs Resolved
Comment thread samply/src/linux/profiler.rs Resolved
Comment thread samply/src/linux_shared/converter.rs Resolved
Comment thread samply/src/mac/profiler.rs Resolved
Remove redundant formatting and unused imports, provide Default implementations, and name specialized iterator conversions explicitly. Use Infallible for the Linux profiler, which never returns Err.
Add --unwinding-mode fp and dwarf,<bytes> while preserving the default DWARF stack size. Configure perf callchains, user registers, and stack copying for the selected mode. Document frame-pointer requirements and cover CLI validation.
@not-matthias
not-matthias force-pushed the cod-3861-support-samply-fp-unwinding branch from acac9ff to 37b48c5 Compare November 3, 2026 14:46
@not-matthias
not-matthias merged commit 030f827 into codspeed Nov 3, 2026
15 checks passed
@not-matthias
not-matthias deleted the cod-3861-support-samply-fp-unwinding branch November 3, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants